class NavigationResult {
  final bool success;  // 操作是否成功
  final bool popToRoot;  // 是否返回到根页面
  final bool needRefresh;  // 是否需要刷新
  final String? message;  // 可选的消息
  final bool? skip;

  NavigationResult({
    this.success = true,
    this.popToRoot = false,
    this.needRefresh = false,
    this.message,
    this.skip
  });

  static NavigationResult popToHome({String? message}) => NavigationResult(
    success: true,
    popToRoot: true,
    needRefresh: true,
    message: message,
  );

  static NavigationResult refresh({String? message}) => NavigationResult(
    success: true,
    popToRoot: false,
    needRefresh: true,
    message: message,
  );

  static NavigationResult skiped({String? message}) => NavigationResult(
    success: true,
    popToRoot: false,
    needRefresh: false,
    skip:true,
    message: message,
  );
}